package headfirst.designpatterns.leaner.ducks;

import headfirst.designpatterns.leaner.ducks.fly.FlyBehavior;
import headfirst.designpatterns.leaner.ducks.quack.QuackBehavior;

public abstract class SuperDucks {
    FlyBehavior flyBehavior;
    QuackBehavior quackBehavior;



    abstract void display();

    public void performFly() {
        flyBehavior.fly();
    }

    public void performQuack() {
        quackBehavior.quack();
    }

    public void swim() {
        System.out.println("All ducks float, even decoys!");
    }

    public SuperDucks() {
    }

    public SuperDucks(FlyBehavior flyBehavior, QuackBehavior quackBehavior) {
        this.flyBehavior = flyBehavior;
        this.quackBehavior = quackBehavior;
    }

    public void setFlyBehavior(FlyBehavior flyBehavior) {
        this.flyBehavior = flyBehavior;
    }

    public void setQuackBehavior(QuackBehavior quackBehavior) {
        this.quackBehavior = quackBehavior;
    }
}
